package com.bulletelc.apollopre.constants;

/**
 * author: lhl
 * date  : 2017/10/30
 * desc  : 数据库的sql语句 ,注意sql语句拼接时的空格.
 *
 * 数据类型命名规范:DATA_TYPE_+数据类型
 * 生成数据表的SQL命名规范:SQL_CREATE_+表名
 *
 */

public final class DBSql {

    private DBSql() {
        //empty
    }


    private static final String SQL_CREATE_TABLE = "CREATE TABLE ";

    /**
     * 具有自增
     */
    private static final String SQL_CREATE_KEY = "_id integer primary key,";
    /**
     * integer类型
     */
    private static final String DATA_TYPE_INTEGER = " integer";
    /**
     * varchar类型
     */
    private static final String DATA_TYPE_VARCHAR = " varchar";

    /**
     * 用于测试
     */
    public static final String SQL_CREATE_TEST = SQL_CREATE_TABLE + DBConstants.TABLE_NAME_TEST + "("
            + SQL_CREATE_KEY
            + DBConstants.FIELD_TEST_USERNAME + DATA_TYPE_VARCHAR + "(128),"
            + DBConstants.FIELD_TEST_PAW + DATA_TYPE_VARCHAR + "(255),"
            + DBConstants.FIELD_TEST_PHONE + DATA_TYPE_INTEGER + ")";

}
